package com.wlc.springdemo;

import com.wlc.springdemo.po.UserInfo;
import org.apache.ibatis.cache.Cache;
import org.apache.ibatis.cache.CacheException;
import org.apache.ibatis.javassist.bytecode.analysis.Executor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author 王立朝
 * @date 2022/11/22
 * @description:
 */
public class TestSpring {


    public static void main(String[] args) {

        test01();
    }

    public static void testSpringDemo() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        UserInfo userInfo = (UserInfo) context.getBean("userInfo");
        System.out.println("userInfo.toString() = " + userInfo.toString());
        UserInfo userInfo2 = (UserInfo) context.getBean("userInfo");
        System.out.println("(userInfo == userInfo2) = " + (userInfo == userInfo2));
    }

    public static void test01() {
        List list1 = new ArrayList();

        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.add(4);

        List list2 = new ArrayList();

        list2.add(4);
        list2.add(5);
        list2.add(6);
        list2.add(7);

        Set set = new HashSet();
        set.add(1);
        set.add(2);
        set.add(2);
        set.add(3);

        for (Object s : set) {
            System.out.println("s = " + s);
        }

    }
}
